<template>
  <div class="boby-tab-container">
    <div
      v-for="(item, index) in tabs"
      :key="index"
      class="tab"
      :class="{active: active === index}"
      @click="toogle(index)"
    >
      {{ item.label }}
    </div>
  </div>
</template>
<script>
export default {
  props: {
    tabs: [Array],
    active: [Number]
  },
  methods: {
    toogle(index) {
      this.$emit('update:active', index);
    }
  }
};
</script>
<style lang="scss" scoped>
.boby-tab-container {
  display: flex;
  .tab {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 176px;
    height: 40px;
    background-color: #fff;
    font-size: 16px;
    font-weight: bold;
    box-sizing: border-box;
    margin-right: 20px;
    color: #333;
    cursor: pointer;
    border-top: 2px solid transparent;
    border-bottom: 1px solid #f3f4f6;
    &.active {
      border-top: 2px solid #4b90ff;
      color: #4b90ff;
      border-bottom: 1px solid transparent;
    }
  }
}
</style>
